package thread;

/**
 * @User: vitobo
 * @Date: 2024-07-23
 * @Description: 匿名内部类创建 Runnable 子类对象
 */
public class ThreadDemo4 {

    public static void main(String[] args) {
        // 创建一个类, 实现Runnable, 同事创建了类的实例,并且传给了Thread的构造方法
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("hello");
            }
        });
        t.start();
    }
}
